import React, { useState, useRef } from 'react';
import { View, Text } from '@tarojs/components';
import { PullToRefresh, VirtualList, InfiniteScroll, NavBar, Image, Tag, Icon, Button } from '@antmjs/vantui';
import Taro,{getMenuButtonBoundingClientRect} from '@tarojs/taro';
import Invite from "../../../../image/invite.png"
import './index.scss'

export default function AppVersionList() {
    const btn = getMenuButtonBoundingClientRect();
    const [data, setData] = useState([1]);
    const virtualListRef = useRef()

    return (
        <View className='mycoins-frame-view'>
            <NavBar title='福利社' leftArrow leftText={'返回'} onClickLeft={() => Taro.navigateBack()} fixed/>
            <View style={{paddingTop:btn.bottom+20}}>
            <PullToRefresh>
                <VirtualList
                    style={{ padding: 10, boxSizing: 'border-box' }}
                    height="calc(100vh - 135px)"
                    dataSource={data}
                    showCount={3}
                    ref={virtualListRef}
                    ItemRender={({ item }) => {
                        return (
                            <View onClick={()=>Taro.navigateTo({ url: '/pages/home/components/inviter/index' })} className='list-bg-view'>
                                <View className='img'>
                                    <Image width={'100vw'} height={'100px'} src={Invite} />
                                </View>
                                <View className='title'>
                                    邀请小伙伴加入易搜索
                                </View>
                                <View className='sub-title'>
                                    奖励金币，上不封顶！
                                </View>
                            </View>
                        );
                    }}
                />
            </PullToRefresh>
            </View>
        </View>
    );
}